<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>embedme: UdpServer类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="class_udp_server-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">UdpServer类 参考<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>UdpServer类  
 <a href="class_udp_server.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_socket_8h_source.html">Socket.h</a>&gt;</code></p>
<div class="dynheader">
类 UdpServer 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_udp_server.png" usemap="#UdpServer_map" alt=""/>
  <map id="UdpServer_map" name="UdpServer_map">
<area href="class_runnable_protocol.html" title="线程接口 " alt="RunnableProtocol" shape="rect" coords="0,0,112,24"/>
<area href="class_tcp_server.html" title="TcpServer类 " alt="TcpServer" shape="rect" coords="0,112,112,136"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:adf6dbeb29365bf50fef8066bb28b188a"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_udp_server.html#adf6dbeb29365bf50fef8066bb28b188a">initServer</a> (uint16 serverPort, std::string serverIP=&quot;127.0.0.1&quot;, uint32 maxPendings=1)</td></tr>
<tr class="memdesc:adf6dbeb29365bf50fef8066bb28b188a"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化服务器  <a href="#adf6dbeb29365bf50fef8066bb28b188a">更多...</a><br /></td></tr>
<tr class="separator:adf6dbeb29365bf50fef8066bb28b188a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98091976a63665f6c379081f95273a62"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_udp_server.html#a98091976a63665f6c379081f95273a62">startServer</a> ()</td></tr>
<tr class="memdesc:a98091976a63665f6c379081f95273a62"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动服务器  <a href="#a98091976a63665f6c379081f95273a62">更多...</a><br /></td></tr>
<tr class="separator:a98091976a63665f6c379081f95273a62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad18f2533425a859d120516cd839b2c1f"><td class="memItemLeft" align="right" valign="top">sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_udp_server.html#ad18f2533425a859d120516cd839b2c1f">stopServer</a> ()</td></tr>
<tr class="memdesc:ad18f2533425a859d120516cd839b2c1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">停止服务器  <a href="#ad18f2533425a859d120516cd839b2c1f">更多...</a><br /></td></tr>
<tr class="separator:ad18f2533425a859d120516cd839b2c1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afacf9b5e5ed67e53ac4d6af1cadebaf7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_socket.html">Socket</a> **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_udp_server.html#afacf9b5e5ed67e53ac4d6af1cadebaf7">getServerSocket</a> ()</td></tr>
<tr class="memdesc:afacf9b5e5ed67e53ac4d6af1cadebaf7"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取服务端Socket  <a href="#afacf9b5e5ed67e53ac4d6af1cadebaf7">更多...</a><br /></td></tr>
<tr class="separator:afacf9b5e5ed67e53ac4d6af1cadebaf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef89fbbe4ab487ff45a946ab813c18fa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_socket.html">Socket</a> **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_udp_server.html#aef89fbbe4ab487ff45a946ab813c18fa">getClientSocket</a> ()</td></tr>
<tr class="memdesc:aef89fbbe4ab487ff45a946ab813c18fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取客户端Socket  <a href="#aef89fbbe4ab487ff45a946ab813c18fa">更多...</a><br /></td></tr>
<tr class="separator:aef89fbbe4ab487ff45a946ab813c18fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6a00822c7b318204d96057e5913309e"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_udp_server.html#ad6a00822c7b318204d96057e5913309e">recvData</a> (char *buf, sint32 len)</td></tr>
<tr class="memdesc:ad6a00822c7b318204d96057e5913309e"><td class="mdescLeft">&#160;</td><td class="mdescRight">服务器接收数据方法  <a href="#ad6a00822c7b318204d96057e5913309e">更多...</a><br /></td></tr>
<tr class="separator:ad6a00822c7b318204d96057e5913309e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4f6ac2151bbbfd421cbe11df2f4d63e"><td class="memItemLeft" align="right" valign="top">virtual sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_udp_server.html#ab4f6ac2151bbbfd421cbe11df2f4d63e">sendData</a> (const char *buf, sint32 len)</td></tr>
<tr class="memdesc:ab4f6ac2151bbbfd421cbe11df2f4d63e"><td class="mdescLeft">&#160;</td><td class="mdescRight">服务器发送数据方法  <a href="#ab4f6ac2151bbbfd421cbe11df2f4d63e">更多...</a><br /></td></tr>
<tr class="separator:ab4f6ac2151bbbfd421cbe11df2f4d63e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36da1fdf692cbfa1bdf36e8f9f25bdae"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a36da1fdf692cbfa1bdf36e8f9f25bdae"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>serviceLoop</b> ()=0</td></tr>
<tr class="separator:a36da1fdf692cbfa1bdf36e8f9f25bdae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>UdpServer类 </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="aef89fbbe4ab487ff45a946ab813c18fa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_socket.html">Socket</a> ** UdpServer::getClientSocket </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取客户端Socket </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回客户端Socket </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="afacf9b5e5ed67e53ac4d6af1cadebaf7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_socket.html">Socket</a> ** UdpServer::getServerSocket </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取服务端Socket </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回服务端Socket </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="adf6dbeb29365bf50fef8066bb28b188a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 UdpServer::initServer </td>
          <td>(</td>
          <td class="paramtype">uint16&#160;</td>
          <td class="paramname"><em>serverPort</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>serverIP</em> = <code>&quot;127.0.0.1&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32&#160;</td>
          <td class="paramname"><em>maxPendings</em> = <code>1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>初始化服务器 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">serverPort</td><td>服务器端口 </td></tr>
    <tr><td class="paramname">maxConAllows</td><td>服务器最多支持挂起连接数(仅TCP时有效) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="ad6a00822c7b318204d96057e5913309e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 UdpServer::recvData </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>服务器接收数据方法 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>接收缓存 </td></tr>
    <tr><td class="paramname">len</td><td>缓存的大小 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回值ret大于0表示接收到ret个数据,等于0表示断开连接,小于0表示接收失败 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>默认为Socket的接收方法,用户可覆盖以定制自己的接收方法 </dd></dl>

<p>被 <a class="el" href="class_tcp_server.html#a734911e336ac9231c6acbbf2494e6ba8">TcpServer</a> 重载.</p>

</div>
</div>
<a class="anchor" id="ab4f6ac2151bbbfd421cbe11df2f4d63e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 UdpServer::sendData </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>服务器发送数据方法 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>发送数据 </td></tr>
    <tr><td class="paramname">len</td><td>数据长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回发送的数据长度,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>默认为Socket的发送方法,用户可覆盖以定制自己的发送方法 </dd></dl>

<p>被 <a class="el" href="class_tcp_server.html#a3b42dcd08441b83b3474a1647df9211e">TcpServer</a> 重载.</p>

</div>
</div>
<a class="anchor" id="a98091976a63665f6c379081f95273a62"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 UdpServer::startServer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>启动服务器 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="ad18f2533425a859d120516cd839b2c1f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint32 UdpServer::stopServer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>停止服务器 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>libemb/inc/<a class="el" href="_socket_8h_source.html">Socket.h</a></li>
<li>libemb/src/Socket.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2016年 七月 7日 星期四 19:49:39 , 为 embedme使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
